package com.ghsc.ghxc.jsb.ui.mall.view

import android.content.Context
import android.content.Intent
import android.os.Bundle
import android.view.View
import android.widget.TextView
import com.cn.appcore.ext.setSingleClickListener
import com.ghsc.ghxc.jsb.R
import com.ghsc.ghxc.jsb.ui.live.activity.ShareFriendsListActivity
import com.ghsc.ghxc.jsb.ui.live.activity.ShareGroupListActivity
import com.ghsc.ghxc.jsb.ui.mall.bean.MaterialBean
import com.lxj.xpopup.core.BottomPopupView

/**
 * 项目：GuoHuaJsb
 * 包名：com.ghsc.ghxc.jsb.ui.mall.view
 * 类名：SourceSharePopupView
 * 创建时间：2024/5/17 11:54
 * 创建人 @author： xiaolin
 * 描述 ：Todo...分享
 */
class SourceSharePopupView (context: Context, bean : MaterialBean) : BottomPopupView(context) {



    override fun getImplLayoutId() = R.layout.live_share
    private val mContext = context
    private val mBean = bean


    override fun onCreate() {
        super.onCreate()

        findViewById<TextView>(R.id.title).text="一键转发"
        findViewById<TextView>(R.id.tvCopy).visibility= View.GONE
        findViewById<TextView>(R.id.tvShareFriends).setSingleClickListener {
            val intent = Intent(context, ShareFriendsListActivity().javaClass)
            var  bundle = Bundle()
            bundle.putSerializable("bean", mBean)
            bundle.putInt("signIndex", 2)
            intent.putExtras(bundle)
            context!!.startActivity(intent)
            dismiss()
        }
        findViewById<TextView>(R.id.tvShareGroup).setSingleClickListener {
            val intent = Intent(context, ShareGroupListActivity().javaClass)
            var  bundle = Bundle()
            bundle.putSerializable("bean", mBean)
            bundle.putInt("signIndex", 2)
            intent.putExtras(bundle)
            context!!.startActivity(intent)
            dismiss()
        }
        findViewById<TextView>(R.id.tvBtnCancel).setSingleClickListener {
            dismiss()
        }
    }

    override fun getMaxWidth() = 0
}